﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DAL.Entiteti;

namespace KSZ
{
    public partial class IzbaciIgraca : Form
    {
        List<Igrac> lista_igraca = new List<Igrac>();
        List<Igrac> temp_lista = new List<Igrac>();
        Igrac OdabraniIgrac = null;
        public IzbaciIgraca()
        {
            InitializeComponent();
        }

        private void IzbaciIgraca_Load(object sender, EventArgs e)
        {
            DAL.DAL d = DAL.DAL.Instanca;
            d.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
            DAL.DAL.IgracDAO cd = new DAL.DAL.IgracDAO();
            lista_igraca = cd.getAll();
            d.terminirajKonekciju();
            comboBox1.DataSource = lista_igraca;
        }

        private void comboBox1_TextChanged(object sender, EventArgs e)
        {
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
           
        }

        private void button1_Click(object sender, EventArgs e)
        {
            DAL.DAL d = DAL.DAL.Instanca;
            d.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
            DAL.DAL.IgracDAO cd = new DAL.DAL.IgracDAO();
            cd.delete(OdabraniIgrac);
            d.terminirajKonekciju();
        }
    }
}
